<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
    <link rel="stylesheet" href="../../static/layui/css/layui.css" th:href="@{/static/layui/css/layui.css}" media="all">
    <link rel="stylesheet" href="../../static/css/bootstrap.min.css"  th:href="@{/static/bootstrap-3.3.7/css/bootstrap.css}"/>
    <link href="//hnres.etalk365.com/public/css/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" th:href="@{https://hkres.etalk365.com/public/lib/bootstrap-select/2.0.0-beta1/css/bootstrap-select.css}">
       <style type="text/css">
        html,body{
            height: 100%;
            background: #eee;
        }
        .nav{
            height: 42px;
            line-height: 40px;
            background: #fff;
            padding: 0 10px;
            position: relative;
        }
        .select{
            cursor: pointer;
        }
        .select_item{
            margin-right: 5px;
            display: inline-block;
        }
        .select_icon{
            width: 22px;
            vertical-align: middle;
        }
        .select_box{
            position: absolute;
            top:42px;
            left: 0;
            width: 15%;
            background: #fff;
            display: none;
            z-index:200;
        }
        .select_box li{
            height: 40px;
            line-height: 40px;
            text-align: center;
        }
        .select_box li:hover{
            background: #eee;
            cursor: pointer;
        }
        .main{
            position: relative;
            margin-left: 0px;
        }
        .main .main-box{
            margin-top: 10px;
            padding-left: 0;
        }
        .main .main-item{
            background: #fff;
        }
        .main .title{
            height: 50px;
            line-height: 50px;
            color: #fff;
            padding: 0 5px;
        }
        .main .title .pull-left img{
            width: 20px;
            vertical-align: middle;
            margin-right: 5px;
        }
        .main .title .pull-right img{
            width: 20px;
            vertical-align: middle;
            cursor: pointer;
        }
        .main .title_bg1{
            background: #FF6600;
        }
        .main .title_bg2{
            background: #46BA7D;
        }
        .main .title_bg3{
            background: #FFCC00;
        }
        .main .title_bg4{
            background: #19a2e3;
        }
        .main .content{
            height: 400px;
        }
       .date_box,.selectbox{
            margin-right: 5px;
        }

       .modal_nestable{
            width: 100%;
            height: 100%;
            background: #fff;
            position: relative;
        }
       .list_nestable li{
            width: 100%;
            height: 40px;
            background: #fff;
            line-height: 40px;
            margin-bottom: 10px;
			border:1px solid #eee;
        }
       .main .title{
            position: relative;
        }
       .selectBox{
            position: absolute;
            top:50px;
            right: 0;
            width: 160px;
            background: #fff;
            z-index: 100;
            color: #000;
            /*text-align: center;*/
            padding-left: 10px;
            display: none;
        }
        .selectBox li:hover{
            background: #eee;
            cursor: pointer;

        }

        .icon img{
            width: 30px;
            height: 30px;
            margin-left: 5px;
            border: 1px solid #DFDFDF;
        }
        .icon{
            text-decoration: none;
        }
    </style>
<body>
    <div class="container-fluid">
        <input th:value="${oldCrmUrl}" type="hidden" id="url">
        <div class="nav" th:if="${roleId==12 or roleId==9}">
            <div class="pull-left select"><span th:text="${loginName}" class="select_item">E0012</span><img src="../../static/img/select_icon.png" class="select_icon" /></div>
            <div class="pull-right"><button type="button"  onclick="sortConfig()" class="btn">设置工作台视图</button></div>
            <ul id="selectUser"  class="list-unstyled select_box" style="border: solid 1px #e6e6e6;overflow-y: auto;max-height: calc(100vh - 50px);">
                <li class="users" th:id="${session.userid}" th:text="${session.loginname}"></li>
                <li class="users" th:each="ccOrSSCList,ccOrSSCListStat: ${ccOrSSCList}" th:text="${ccOrSSCList.loginName}" th:attr="value=${ccOrSSCList.id}"></li>
            </ul>
        </div>
        <div class="nav" th:if="${roleId==1 or roleId==14}">
            <div class="pull-right"><button type="button"  onclick="sortConfig()" class="btn">设置工作台视图</button></div>
            <select id="listCc" style="display: none;" th:if="${session.storesId==1}">
                <optgroup th:each="item:${ccList}" th:label="${item.name}">
                    <option th:each="oitem:${item.list}" th:value="${oitem.id}" th:text="${oitem.name}"></option>
                </optgroup>
            </select>
            <select id="listCc" style="display: none;" th:unless="${session.storesId==1}">
                <option th:each="sscUser: ${ccList}" th:text="${sscUser.loginName}" th:value="${sscUser.id}"></option>
            </select>
            <select id="listSsc" style="display: none;">
                <option th:each="sscUser: ${sscList}" th:text="${sscUser.loginName}" th:value="${sscUser.id}"></option>
            </select>
        </div>
        <div style="padding-bottom: 15px;">
            <div class="row main">
                <div class="gridly">

                </div>
            </div>
        </div>
    </div>
    <script src="https://hkres.etalk365.com/public/lib/jquery/jquery.min.js" type="text/javascript"></script>
    <script src="../../static/js/jquery.gridly.js" th:src="@{/static/js/jquery.gridly.js}"></script>
    <script src="../../static/layui/layui.js" th:src="@{/static/layui/layui.js}" ></script>
    <script src="https://hkres.etalk365.com/public/lib/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script th:src="@{https://hkres.etalk365.com/public/lib/bootstrap-select/2.0.0-beta1/js/bootstrap-select.min.js}"></script>
    <script src="https://hkres.etalk365.com/public/lib/bootstrap-select/2.0.0-beta1/js/i18n/defaults-zh_CN.min.js"></script>
    <script src="../../static/js/publicUtils.js" th:src="@{/static/js/publicUtils.js?v=2021011916}" charset="utf-8"></script>
    <script src="../../static/newMain/pubConfig.js" th:src="@{/static/newMain/pubConfig.js?v=2021072301}" charset="utf-8"></script>
    <script src="../../static/js/layerStudentInfo.js" th:src="@{/static/js/layerStudentInfo.js?v=20210408}" charset="utf-8"></script>
    <script th:if="${roleId == 19}" src="../../static/newMain/ykNewMain.js" th:src="@{/static/newMain/ykNewMain.js}" charset="utf-8"></script>
    <script th:if="${roleId == 2 or roleId == 12}" src="../../static/newMain/ccNewMain.js" th:src="@{/static/newMain/ccNewMain.js?v=20210708}" charset="utf-8"></script>
    <script th:if="${roleId == 2 or roleId == 12}" src="../../static/js/callandsms.js" th:src="@{/static/js/callandsms.js}" charset="utf-8"></script>
    <script th:if="${roleId == 2 or roleId == 12}" src="https://hkres.etalk365.com/public/lib/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script th:if="${roleId == 8 or roleId == 9}" src="../../static/workflow/workflow_list.js" th:src="@{/static/workflow/workflow_list.js?v=20201020}"></script>
    <script th:if="${roleId == 8 or roleId == 9}" src="../../static/newMain/sscNewMain.js?v=20201118" th:src="@{/static/newMain/sscNewMain.js?v=20210710}" charset="utf-8"></script>
    <script th:if="${roleId == 1 or roleId == 14}" src="../../static/newMain/adminNewMain.js?v=20210630" th:src="@{/static/newMain/adminNewMain.js?v=2021072301}" charset="utf-8"></script>

    <script>
        // 下拉菜单
        $(".select").click(function(e){
            $(".select_box").toggle();
            e.stopPropagation();
        });

        //点击切换用户
        $(".users").click(function(){
            $(".select_item").text($(this).text());
            $(".select_item").attr("value",$(this).attr("value"));
            let head = $("head");
            let script = $("<script>");
            $(script).attr('type','text/javascript');
            $(".gridly").empty();
            if([[${roleId}]] == 12){
                $("script[src='../../static/newMain/ccNewMain.js']").remove();
                $(script).attr('src','../../static/newMain/ccNewMain.js');
            }
            if([[${roleId}]] == 9){
                $("script[src='../../static/newMain/sscNewMain.js']").remove();
                $(script).attr('src','../../static/newMain/sscNewMain.js');
            }
            $(head).append(script);
        });

        //点击任意地方隐藏下拉
        $(document).click(function () {
            $(".select_box").hide()
            $(".selectBox").hide()
        });

    </script>
</body>
</html>
